package com.alison.SmartCli;

import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;

public class MethodData {
    private static Map<String,Class> methodClassMap = new HashMap<>();
    private static Map<String,Method> methodMap = new HashMap<>();
    //保持有序
    private static Map<String,String> usageMap = new LinkedHashMap<>();

    public static void addMethod(String methodName,Method method){
        methodMap.put(methodName, method);
    }

    public static void addUsage(String methodName,String usage){
        usageMap.put(methodName,usage);
    }

    public static void addMethodClass(String methodName,Class clazz){
        methodClassMap.put(methodName,clazz);
    }

    public static boolean containUserMethod(String methodName){
        return methodMap.containsKey(methodName);
    }

    public static Method getMethod(String methodName){
        return methodMap.get(methodName);
    }

    public static Class getMethodClass(String methodName){
        return methodClassMap.get(methodName);
    }

    public static String getUsage(String methodName){
        return usageMap.get(methodName);
    }

}
